package com.sstir.doctor.controller;


import com.sstir.doctor.pojo.vo.QuestionVO;
import com.sstir.doctor.result.RespResult;
import com.sstir.doctor.service.IQueListService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author hanjunjun
 * @since 2021-01-15
 */
@RestController
@RequestMapping("/queList")
@CrossOrigin
@Api(tags = "选择题")
public class QueListController {

    @Autowired
    private IQueListService queListService;

    @PostMapping("/addQuestion")
    @ApiOperation("向数据库添加一个问题")
    public RespResult addQuestion(@RequestBody @Validated QuestionVO questionVO){
        return queListService.addQuestion(questionVO);
    }

}
